package com.dinzeer.balmung.data;

import mods.flammpfeil.slashblade.init.SBItems;
import mods.flammpfeil.slashblade.recipe.RequestDefinition;
import mods.flammpfeil.slashblade.recipe.SlashBladeIngredient;
import mods.flammpfeil.slashblade.recipe.SlashBladeShapedRecipeBuilder;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.RecipeProvider;
import net.minecraft.world.item.Items;
import net.minecraftforge.common.crafting.conditions.IConditionBuilder;

import java.util.function.Consumer;

public class BARecipeProvoider extends RecipeProvider implements IConditionBuilder {
    //合成表datagen
    public BARecipeProvoider(PackOutput output) {
        super(output);
    }

    @Override
    protected void buildRecipes(Consumer<FinishedRecipe> consumer) {
        SlashBladeShapedRecipeBuilder.shaped(BABuiltInRegsitry.BALMUNG.location())
                .pattern("ABA")
                .pattern("CDC")
                .pattern("AEA")
                .define('A', SBItems.proudsoul_ingot)
                .define('B', Items.EMERALD)
                .define('C', SBItems.proudsoul_sphere)
                .define('D', SlashBladeIngredient.of(
                        SBItems.slashblade_white, RequestDefinition.Builder.newInstance()
                                .killCount(200)
                                .proudSoul(1000)
                                .refineCount(1)
                                .build()
                ))
                .define('E',Items.GOLD_BLOCK)
                .unlockedBy(getHasName(SBItems.slashblade), has(SBItems.slashblade)).save(consumer);
    }
}
